package com.oauth.yahoo.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.oauth.components.client.ui.gadgets.ProfileInfoPanel;
import com.oauth.yahoo.client.beans.YahooModel;
import com.oauth.yahoo.client.rpc.YahooRemoteServiceAsync;

public class HomePanel extends Composite {

	private static HomePanelUiBinder uiBinder = GWT.create(HomePanelUiBinder.class);

	interface HomePanelUiBinder extends UiBinder<Widget, HomePanel> {
	}

	@UiField
	HorizontalPanel hPanel1;

	@UiField
	ProfileInfoPanel infoPanel;

	@UiField
	Image yahooImage;

	private YahooRemoteServiceAsync mService;

	public HomePanel() {
		initWidget(uiBinder.createAndBindUi(this));
		hPanel1.setCellHorizontalAlignment(infoPanel, VerticalPanel.ALIGN_LEFT);
		hPanel1.setCellHorizontalAlignment(yahooImage, VerticalPanel.ALIGN_RIGHT);
	}

	public void setData(YahooModel pYahooModel) {
		/*
		 * infoPanel.addValueChangeHandler(new StatusUpdateHandler(mService,
		 * tweetsPanel)); YahooUser user = pYahooModel.getUser();
		 * infoPanel.setData(user.getProfileImageUrl(), user.getName(),
		 * user.getStatus()); tweetsPanel.addTweet(pYahooModel.getTweets());
		 */
	}

	public void setService(YahooRemoteServiceAsync pYahooService) {
		mService = pYahooService;
	}

}
